<%= form_with(model: product, local: true) do |form| %>
  <% if product.errors.any? %>
    <div id="error_explanation">
      <h2><%= pluralize(product.errors.count, "error") %> prohibited this product from being saved:</h2>

      <ul>
      <% product.errors.full_messages.each do |message| %>
        <li><%= message %></li>
      <% end %>
      </ul>
    </div>
  <% end %>

  <div class="field">
    <%= form.label "名称：" %>
    <%= form.text_field :name, id: :product_name %>
  </div>

  <div class="field">
    <%= form.label "价格：" %>
    <%= form.text_field :price, id: :product_price %>
  </div>

  <div class="field">
  <%= form.label "数量：" %>
  <%= form.text_field :amount, id: :product_amount %>
  </div>

  <div class="field">
    <%= form.label "备注：" %>
    <%= form.text_area :remark, id: :product_remark %>
  </div>

  <div class="actions">
    <%= form.submit "提交" %>
  </div>
<% end %>
